<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    div{
        width: 100px;
        height:100px;
        background-color: rgb(42, 230, 237);
        position:relative;
        text-align: center;
        line-height: 100px;
        border-width: 1px;
        border-style: solid;

    }
</style>
<body>
    <div></div>
</body>
<script>
    const div = document.querySelector('div');
    let i = 10;
    div.innerHTML = i;
    const timer = setInterval(()=>{
        i--;
        div.innerHTML = i;
        if(i == 0){
            clearInterval(timer);
        }
    },1000)
</script>
</html>